package pl.edu.pw.elka.dzielins.revanalyzer.model;

import org.apache.commons.lang3.StringUtils;

import edu.mit.csail.sdg.alloy4compiler.ast.Expr;

public class ModelFact {
	private String name;
	private Expr expression;
	private String[] declaration;
	
	public ModelFact() {
		
	}
	
	public ModelFact(String name, Expr expression) {
		this.name = name;
		this.expression = expression;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Expr getExpression() {
		return expression;
	}
	public void setExpression(Expr expression) {
		this.expression = expression;
	}
	public String getExpressionAsString() {
		return StringUtils.remove(expression.toString(), "this/");
	}
	public String[] getDeclaration() {
		return declaration;
	}
	public void setDeclaration(String[] declaration) {
		this.declaration = declaration;
	}

	@Override
	public String toString() {
		String s=name+" {\n\t"+getExpressionAsString()+"\n}";
		return s;
	}
}
